﻿using System.ComponentModel.Composition;
using Roslyn.Compilers.Common;
using Roslyn.Compilers.CSharp;
using RoslynCompiler.MEF;

namespace NotifyPropertyChanged
{
    [Export(typeof(ICodeRewriter))]
    public class NotifyPropertyChangedCodeRewriter : ICodeRewriter
    {
        public SyntaxNode Rewrite(SyntaxNode originalNode, int rewriterIndex, ISemanticModel semanticModel)
        {
            switch (rewriterIndex)
            {
                case 0 :
                    return new NotifyPropertyChangedRewriter(semanticModel).Visit(originalNode);
            }
            return originalNode;
        }

        public int RewriterCount
        {
            get { return 1; }
        }
    }
}
